package com.fernandomartines.dbcheck.graph.element;

import com.fernandomartines.dbcheck.sql.SQLGenerator;
import java.io.Serializable;

public class ModelGraphAttribute implements Serializable {

    private String id;
    private String name;
    private String type;
    private Object defaultValue;
    private ModelGraphQualifiers qualifiers;
    private ModelGraphConstraints constraints;

    // constructors

    public ModelGraphAttribute() {
        this.id = "";
        this.name = "";
        this.type = "";
        this.defaultValue = new Object();
        this.qualifiers = new ModelGraphQualifiers();
        this.constraints = new ModelGraphConstraints();
    }

    public ModelGraphAttribute(String id, String name) {
        this();
        this.id = id;
        this.name = name;
    }

    // getters and setters

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
        this.setDefaultValue(SQLGenerator.generateDefaultAttributeValue(this, true));
    }

    public Object getDefaultValue() {
        return this.defaultValue;
    }

    public void setDefaultValue(Object defaultValue) {
        this.defaultValue = defaultValue;
    }

    public ModelGraphQualifiers getQualifiers() {
        return qualifiers;
    }

    public void ModelGraphQualifiers(ModelGraphQualifiers qualifiers) {
        this.qualifiers = qualifiers;
    }

    public ModelGraphConstraints getConstraints() {
        return constraints;
    }

    public void setConstraints(ModelGraphConstraints constraints) {
        this.constraints = constraints;
    }

}
